package com.house.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.house.pojo.Housedesign;
import com.house.pojo.Housedoor;
import com.house.pojo.Housefloor;
import com.house.pojo.Housestyle;
import com.house.pojo.Houseuser;
import com.house.pojo.Housewall;
import com.house.service.ChooseService;

@Controller
public class ChooseController {
	
	@Autowired
	private ChooseService chooseService;
	
	@RequestMapping("/choose/user/{userId}")
	@ResponseBody
	public Houseuser getUser(@PathVariable("userId") String userId){
		
		return chooseService.getUserByuserId(userId);
	}
	
	@RequestMapping("/choose/style/{styleSize}")
	@ResponseBody
	public List<Housestyle> getStyle(@PathVariable("styleSize") int styleSize){
		
		List<Housestyle> list = chooseService.getStyleBystyleSize(styleSize);
		
		return  list;
	}
	
	@RequestMapping("/choose/design")
	@ResponseBody
	public List<Housedesign> getDesign(){
		
		List<Housedesign> design = chooseService.getAllDesign();
		
		return design;
	}
	
	@RequestMapping("/choose/door")
	@ResponseBody
	public List<Housedoor> getDoor(){
		
		List<Housedoor> door = chooseService.getAllDoor();
		
		return door;
	}
	
	@RequestMapping("/choose/floor")
	@ResponseBody
	public List<Housefloor> getFloor(){
		
		List<Housefloor> floor = chooseService.getAllFloor();
		
		return floor;
	}
	
	@RequestMapping("/choose/wall")
	@ResponseBody
	public List<Housewall> getWall(){
		
		List<Housewall> wall = chooseService.getAllWall();
		
		return wall;
	}

}
